// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:flutter_app/utils/sp_utils.dart';
import 'package:flutter_app/utils/timer_utils.dart';
import 'package:flutter_app/values/CommonParam.dart';
import 'package:flutter_test/flutter_test.dart';

// void main() {
//   testWidgets('Counter increments smoke test', (WidgetTester tester) async {
//     // Build our app and trigger a frame.
//     await tester.pumpWidget(MyApp());
//
//     // Verify that our counter starts at 0.
//     expect(find.text('0'), findsOneWidget);
//     expect(find.text('1'), findsNothing);
//
//     // Tap the '+' icon and trigger a frame.
//     await tester.tap(find.byIcon(Icons.add));
//     await tester.pump();
//
//     // Verify that our counter has incremented.
//     expect(find.text('0'), findsNothing);
//     expect(find.text('1'), findsOneWidget);
//   });
// }

void main() {
  test(" 测试sp无法获取值问题", () async {
    print("开始测试");
    await sp.remove(CommonParam.UPGRADE_DATE);

    // SpUtils.getInstance().then((spUtils) {
    //   spUtils.setString("token", "value").then((value) => print(value));
    // });
    //
    // sp.setString("token", "value").then((value) => toast.show(value.toString()));
    

    // SpUtils spUtils = SpUtils.getInstance();
    // print("spUtils=" + spUtils.toString());
    //
    // spUtils.setString("token", "value").then((value) => print(value));
    //
    // spUtils.contains("token").then((value) => print(value));
    print("测试结束");
  });

  test("测试 读取Exif信息", () async {
    print("开始测试");


    print("测试结束");

  });


  test("计时器工具类 测试", () {
    TimerUtils().startTimer();
  });

}

String getTime(String diffHour) {
  int hour = 0;
  try {
    hour = int.parse(diffHour);
  } on Exception catch (e) {

  }
  if (hour < 24) {
    return hour.toString() + "小时前";
  } else {
    return (hour ~/ 24).toString() + "天前";
  }
}
